package people.paper.tv.receiver.vc;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

/**
 * Created by Gwen on 2018/5/16.
 */

public class VoiceCmd implements Serializable {
    public static class VoiceCmdDetail implements Serializable {
        //            "original":"射手榜查询",
        //                    "parameter":"4"
        public String original;
        public String parameter;

        @Override
        public String toString() {
            return "VoiceCmdDetail{" + "original='" + original + '\'' + ", parameter='" + parameter +
                    '\'' + '}';
        }
    }

    // {"command":24,"detail":{"original":"射手榜查询","parameter":"4"}}
    public int command;
    public VoiceCmdDetail detail;

    @Override
    public String toString() {
        return "VoiceCmd{" + "command=" + command + ", detail=" + detail + '}';
    }

    public static final VoiceCmd parse(String message) {
        return JSONObject.parseObject(message, VoiceCmd.class);
    }
}
